From: Paul Eggert Date: Fri, 1 Jul 2011 01:52:41 +0000 (-0700) Subject: * nxml/rng-maint.el (rng-time-function): Rewrite using time-subtract. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~3214^2~5 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=8f761e3b302e3552d60253a6f531c3ff45de23ce;p=emacs.git * nxml/rng-maint.el (rng-time-function): Rewrite using time-subtract. This yields a more-accurate answer. (rng-time-to-float): Remove; no longer needed. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0464d5279fa..7ebf5c05ef6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2011-07-01 Paul Eggert + * nxml/rng-maint.el (rng-time-function): Rewrite using time-subtract. + This yields a more-accurate answer. + (rng-time-to-float): Remove; no longer needed. + * emacs-lisp/timer.el (timer-relative-time): Use time-add. * calendar/timeclock.el (timeclock-seconds-to-time): diff --git a/lisp/nxml/rng-maint.el b/lisp/nxml/rng-maint.el index d31740f0ca2..bd5b3136d54 100644 --- a/lisp/nxml/rng-maint.el +++ b/lisp/nxml/rng-maint.el @@ -224,19 +224,13 @@ ;;; Timing -(defun rng-time-to-float (time) - (+ (* (nth 0 time) 65536.0) - (nth 1 time) - (/ (nth 2 time) 1000000.0))) - (defun rng-time-function (function &rest args) (let* ((start (current-time)) (val (apply function args)) (end (current-time))) (message "%s ran in %g seconds" function - (- (rng-time-to-float end) - (rng-time-to-float start))) + (float-time (time-subtract end start))) val)) (defun rng-time-tokenize-buffer ()